﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CarLoanSystem.Web.Comman
{
    public class UserControlManageForm : System.Web.UI.UserControl
    {
        public int NextSeq
        {
            get
            {
                int i = 0;

                if (this.ViewState["Seq"] == null)
                    i = 0;
                else
                    i = Convert.ToInt32(this.ViewState["Seq"]);

                i += 1;

                this.ViewState["Seq"] = i;

                return i;
            }
        }

        public enum Action
        {
            Add,
            Edit,
            Delete,
            View,
            SubAdd
        };

        public Action Mode
        {
            get
            {
                return (Action)ViewState["Mode"];
            }
            set
            {
                ViewState["Mode"] = value;
            }
        }

        public string TransactionID
        {
            get
            {
                try
                {
                    return ViewState["TransactionID"].ToString();
                }
                catch
                {
                    return null;
                }
            }
            set
            {
                ViewState["TransactionID"] = value;
            }
        }
    }
}
